Skip to content

Conversation

@sanderegg
Copy link
Member

@sanderegg sanderegg commented Jul 25, 2025

What do these changes do?

  • ensures a projectUpdateEvent is emitted on project close
  • refactors the garbage-collector to also use the same code for closing projects instead of doing its own stuff
  • sorry: a bit more refactoring

Related issue/s

How to test

Dev-ops

@sanderegg sanderegg added this to the Engage milestone Jul 25, 2025
@sanderegg sanderegg requested a review from Copilot July 25, 2025 14:33
@sanderegg sanderegg self-assigned this Jul 25, 2025
@sanderegg sanderegg added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jul 25, 2025

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 98.16514% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.99%. Comparing base (9845835) to head (7260add).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8163      +/-   ##
==========================================
+ Coverage   87.93%   87.99%   +0.05%     
==========================================
  Files        1716     1769      +53     
  Lines       68890    69675     +785     
  Branches     1056     1182     +126     
==========================================
+ Hits        60580    61309     +729     
- Misses       7988     8014      +26     
- Partials      322      352      +30     
Flag Coverage Δ
integrationtests 64.12% <75.75%> (-0.06%) ⬇️
unittests 86.56% <98.16%> (+0.08%) ⬆️
Components Coverage Δ
pkg_aws_library 93.93% <ø> (ø)
pkg_celery_library 87.34% <ø> (ø)
pkg_dask_task_models_library 79.62% <ø> (ø)
pkg_models_library 93.12% <100.00%> (-0.01%) ⬇️
pkg_notifications_library 85.26% <ø> (ø)
pkg_postgres_database 88.02% <ø> (∅)
pkg_service_integration 70.19% <ø> (ø)
pkg_service_library 71.37% <ø> (ø)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.16% <ø> (+0.11%) ⬆️
agent 93.81% <ø> (ø)
api_server 93.08% <ø> (ø)
autoscaling 95.88% <ø> (ø)
catalog 92.34% <ø> (ø)
clusters_keeper 99.13% <ø> (ø)
dask_sidecar 91.59% <ø> (∅)
datcore_adapter 97.94% <ø> (ø)
director 76.14% <ø> (-0.10%) ⬇️
director_v2 91.02% <ø> (-0.13%) ⬇️
dynamic_scheduler 96.27% <ø> (ø)
dynamic_sidecar 90.10% <ø> (+2.78%) ⬆️
efs_guardian ∅ <ø> (∅)
invitations 91.44% <ø> (ø)
payments ∅ <ø> (∅)
resource_usage_tracker 92.50% <ø> (-0.06%) ⬇️
storage 86.60% <ø> (+0.16%) ⬆️
webclient ∅ <ø> (∅)
webserver 88.06% <97.97%> (+<0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9845835...7260add. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sanderegg sanderegg requested a review from Copilot July 28, 2025 06:13
@sanderegg sanderegg force-pushed the i8151/emit-event-when-user-closes-project branch from 992ef20 to 2e952ec Compare July 28, 2025 06:13

This comment was marked as outdated.

@sanderegg sanderegg changed the title 🎨♻️Simulatneous access: emit project update event when a user closes a project or the GC closes it 🎨♻️Simultaneous access: emit project update event when a user closes a project or the GC closes it Jul 28, 2025
@sanderegg sanderegg requested review from Copilot and odeimaiz July 28, 2025 09:48
@sanderegg sanderegg marked this pull request as ready for review July 28, 2025 09:48

This comment was marked as outdated.

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci!

@sanderegg sanderegg force-pushed the i8151/emit-event-when-user-closes-project branch from f6eccdb to 9e0b3ab Compare July 28, 2025 12:35
@sanderegg sanderegg requested a review from Copilot July 28, 2025 12:36

This comment was marked as outdated.

@sanderegg sanderegg requested a review from Copilot July 28, 2025 13:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the simultaneous access system to emit project update events when a user closes a project or when the garbage collector (GC) closes it. The changes consolidate project closing logic by making the GC use the same code path as user-initiated project closure, ensuring consistent event emission.

  • Refactors the garbage collector to use the same project closing mechanism as user actions
  • Introduces a new UserSession model to replace the previous dict-based approach for better type safety
  • Consolidates project closing logic to ensure project update events are emitted in all scenarios

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
services/web/server/src/simcore_service_webserver/resource_manager/models.py Introduces new UserSession pydantic model with redis key serialization methods
services/web/server/src/simcore_service_webserver/resource_manager/registry.py Updates registry to use UserSession model instead of dict-based approach
services/web/server/src/simcore_service_webserver/projects/_projects_service.py Refactors project closing logic and renames function for clarity
services/web/server/src/simcore_service_webserver/garbage_collector/_core_disconnected.py Simplifies GC logic to use the unified project closing mechanism
Multiple test files Updates tests to use the new UserSession model and improved socketio connection handling

@sanderegg sanderegg force-pushed the i8151/emit-event-when-user-closes-project branch from bf737d2 to f1d5bd0 Compare July 28, 2025 13:23
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say it looks OK, I have a few questions

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

@sanderegg sanderegg added the 🤖-automerge marks PR as ready to be merged for Mergify label Jul 28, 2025
@sanderegg
Copy link
Member Author

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jul 28, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images
      • any of: [🛡 GitHub branch protection]
        • check-success = SonarCloud Code Analysis
        • check-neutral = SonarCloud Code Analysis
        • check-skipped = SonarCloud Code Analysis
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed

@sanderegg sanderegg force-pushed the i8151/emit-event-when-user-closes-project branch from 43b8ba6 to 7260add Compare July 28, 2025 16:37
@sonarqubecloud
Copy link

@sanderegg sanderegg merged commit ef83d12 into ITISFoundation:master Jul 28, 2025
60 checks passed
@sanderegg sanderegg deleted the i8151/emit-event-when-user-closes-project branch July 28, 2025 17:09
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When a user leaves a collaborative project the frontend shall receive a project update event

4 participants